package com.bjesc_b2c.app.appraiset.mvp.presenter.impl;

import android.content.Context;

import com.bjesc_b2c.app.appraiset.mvp.model.DealerModel;
import com.bjesc_b2c.app.appraiset.mvp.model.impl.DealerModelImpl;
import com.bjesc_b2c.app.appraiset.mvp.presenter.DealerPresenter;
import com.bjesc_b2c.app.appraiset.mvp.view.DealerView;

import master_bean.DealerBean;

/**
 * Created by yidong on 2017/8/14.
 */

public class DealerPresenterImpl implements DealerPresenter,DealerModelImpl.CallBack {
    private DealerView dealerView;
    private DealerModel model;

    public DealerPresenterImpl(DealerView dealerView) {
        this.dealerView = dealerView;
        model = new DealerModelImpl(this);
    }

    @Override
    public void getDealerinfo(Context context, String dealerID) {
        model.getDealerinfo(context,dealerID);
    }

    @Override
    public void editDealer(Context context, DealerBean bean) {
        model.editDealer(context,bean);
    }

    @Override
    public void addDealer(Context context, DealerBean bean) {
        model.addDealer(context,bean);
    }

    @Override
    public void callback(DealerBean bean) {
        dealerView.getDealerInfo(bean);
    }

    @Override
    public void loadStart() {
        dealerView.loadStart();
    }

    @Override
    public void loadCompleted() {
        dealerView.loadCompleted();
    }

    @Override
    public void loadFailure() {

    }
}
